package cn.com.cifi.mars.mapper.mars;

import cn.com.cifi.mars.entity.UploadFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * 上传
 * @author Administrator
 *
 */
public interface FileUploadMapper extends BaseMapper<UploadFile> {

    //查询是否有相同的文件名
//    List<UploadFile> selectSameFileName(@Param("name") String fileName);
    //上传成功后向t_file_upload插入记录
    void saveFileUploadRecord(UploadFile uploadFile);
    //根据fileId查询文件存储路径
    UploadFile selectFileById(@Param("fileId") String fileId);
    //t_file_upload插入bill_id和created_by
    void updateBillId(@Param("key") String businessKey,@Param("list")List<String> files);
    //t_file_upload插入pre_view_url
    void updatePreViewUrl(@Param("id")String id,@Param("url") String url);
    //根据businessKey查询上传的文件
//    List<UploadFile> selectFileByBusinessKey(@Param("key") String businessKey,@Param("isDelete") Integer del);

    int updateIsDelete(@Param("fileId") String fileId, @Param("del") int del);

    List<UploadFile>selectByRelationId(@Param("billId")String billId, @Param("del") int del);
}
